package com.cloudbroker.bcs.platform.ltb.middle.service.impl;

import com.cloudbroker.bcs.common.dao.base.DAOBase;
import com.cloudbroker.bcs.platform.ltb.common.config.ConfigValues;
import com.cloudbroker.bcs.platform.ltb.middle.dao.PushMsgDAO;
import com.cloudbroker.bcs.platform.ltb.middle.entity.PushMsg;
import com.cloudbroker.bcs.platform.ltb.middle.service.PushMsgService;
import com.cloudbroker.bcs.platform.ltb.middle.service.base.TenantServiceImplBase;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by daibd19671 on 2016/12/16.
 */
@Service
public class PushMsgServiceImpl extends TenantServiceImplBase<PushMsg, String> implements PushMsgService {
    @Resource
    private PushMsgDAO pushMsgDAO;

    @Override
    protected DAOBase<PushMsg, String> getDAO() {
        return pushMsgDAO;
    }

    public PushMsg getPushMsg(PushMsg pushMsg) {
        return pushMsgDAO.getPushMsg(pushMsg);
    }

    public void addPushMsg(PushMsg pushMsg) {
        pushMsg.setMycat_flag(ConfigValues.getMycatFlag());
        pushMsgDAO.addPushMsg(pushMsg);
    }
}
